const { Schema, SchemaTypes } = require('../schema');
// 余额账户，每个区域都会有一个账户
class ChargeAccount extends Schema {
    PropertyModelDataTemplate () {
        return {
            userId: { type: SchemaTypes.ObjectId, required: true },
            areaId: { type: SchemaTypes.ObjectId, required: true },
            isEnable: { type: SchemaTypes.Boolean, required: true, default: true },
            createTime: { type: SchemaTypes.Number, required: true, default: require('../../module/tool/time').getCurrentTimestamp() },

            // 账户总余额
            totalAmount: { type: SchemaTypes.Number, required: true, default: 0 },
            // 累计使用金额
            totalUsedAmount: { type: SchemaTypes.Number, required: true, default: 0 }
        };
    }
}

module.exports = ChargeAccount;
